var user = {
    username: "ymz",
    age: 20,
    gender: "男",
};

var { username, age, gender } = user;

console.log("username:\t", username);
console.log("age:\t", age);
console.log("gender:\t", gender);

// 解构赋值中的属性没有次序，赋值的变量名称必须和属性同名，才能得到正确的值
var { n1, n2, n3 } = user; // undefined
console.log(n1, n2, n3);
